/*
  Name: DeadProxyServerToClientThread.h
  Copyright:
  Author: Carl Chatfield
  Date: 11/01/08 12:36
  Description: Transfers control to the Server to Proxy Loop
*/


#ifndef __DEADPROXYSERVERTOCLIENTTHREAD_h__
#define __DEADPROXYSERVERTOCLIENTTHREAD_h__

#ifdef __BORLANDC__
	#pragma hdrstop
#endif

#ifndef WX_PRECOMP
	#include <wx/wx.h>
#else
	#include <wx/wxprec.h>
#endif

#include <windows.h>
#include <winsock.h>
#include <stdio.h>
#include "DeadProxyPacketBuffer.h"

class ServerToClientThread : public wxThread
{
    private:
        char buffer[65536];
        void * pClient;
        PacketBuffer * packet;
        SOCKET ToClientSocket;
        SOCKET ToServerSocket;
	public:
        // thread execution starts here
        virtual void * Entry();

        // called when the thread exits - whether it terminates normally or is
        // stopped with Delete() (but not when it is Kill()ed!)
        virtual void OnExit();
        ServerToClientThread(int ClientSocket, int ServerSocket, void* ClientPtr);
};

#endif
